package jrmob.yonyou.com.commonlib.baseui.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import jrmob.yonyou.com.commonlib.baseui.base.BaseActivityMob_lib;


/**
 * 功能: 基类 fragment
 *
 * @author zhangg
 *         <p>
 *         下午5:20:56
 */
public abstract class BaseFragmentMob_lib extends Fragment {

    public BaseActivityMob_lib mActivity;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mActivity = (BaseActivityMob_lib) getActivity();

    }

    // 处理fragment的布局
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return initViews();
    }

    // 依附的activity创建完成
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        initData();
    }




    // 子类必须实现初始化布局的方法
    public abstract View initViews();

    // 初始化数据, 可以不实现
    public abstract void initData();

    @Override
    public void onResume() {
        super.onResume();

    }
}